import request from '@/utils/request'

// 查询余额列表
export function listBalancefind(query) {
  return request({
    url: '/balance/balancefind/list',
    method: 'get',
    params: query
  })
}

// 查询余额详细
export function getBalancefind(id) {
  return request({
    url: '/balance/balancefind/' + id,
    method: 'get'
  })
}
// 新增接口：根据老人ID查询余额
export function getBalanceByElderlyId(elderlyId) {
  return request({
    url: '/balance/balancefind/byElderlyId/' + elderlyId,
    method: 'get'
  })
}

// 新增余额
export function addBalancefind(data) {
  return request({
    url: '/balance/balancefind',
    method: 'post',
    data: data
  })
}

// 修改余额
export function updateBalancefind(data) {
  return request({
    url: '/balance/balancefind',
    method: 'put',
    data: data
  })
}

// 根据老人id修改余额
export function updateBalancefindByElderlyId(data) {
  return request({
    url: '/balance/balancefind/editByElderlyId',
    method: 'put',
    data: data
  })
}

// 删除余额
export function delBalancefind(id) {
  return request({
    url: '/balance/balancefind/' + id,
    method: 'delete'
  })
}

// 根据老人ID查询余额信息
export function getBalanceByElderlyIds(elderlyId) {
  return request({
    url: `/balance/balancefind/elderly/${elderlyId}`,
    method: 'get'
  })
}
